package com.bjgraphite.report.enums;



/**
 * @description: 异常状态码
 * @author： zhouxiaolong
 * @date: 2015年5月12日 下午5:54:57
 * @version: 1.0
 */
public enum BizErrorCode {
    // 系统相关
    MY_CLONE_ERROR(3001,"克隆对象异常。"),
    MY_UTIL_ERROR(300002,"工具类调用错误。"),
    //security 相关
    SECURITY_ACCESS_TOKEN_EXPIRE(4001,"登录超时，请重新登录。"),
    SECURITY_REFRESH_TOKEN_EXPIRE(4002,"登录超时，请重新登录。"),
    SECURITY_TOKEN_ERROR(4003,"登录超时啦！请重新登录。"),
    SECURITY_LOGOUT_SUCCESS(4004,"退出成功"),
    SECURITY_LOGIN_ERROR(4005,"账号或密码错误，请重新登录"),

    // 通用
    SYSTEM_SUCCESS(200000,"操作成功"),
    SYSTEM_ERROR(500,"服务器忙，请稍后重试。"),
    SYSTEM_REMOTE_ERROR(502,"服务调用失败，请稍后重试。"),
    SYSTEM_UNAUTHORIZED(401,"UNAUTHORIZED"),
    SYSTEM_DATAERROR(600,"服务器忙，请稍后重试。"),
    SYSTEM_NOT_FOUND(404, "Resource not found"),
    SYSTEM_DES_DECODE_ERROR(801, "解密失败"),
    SYSTEM_DES_ENCODE_ERROR(802, "加密失败"),
    SYSTEM_BUSY_ERROR(999,"服务器忙，请稍后重试。"),
    SYSTEM_INVALID_ARGUMENT(777, "参数无效");


    private Integer code;
    private String message;


    private BizErrorCode(Integer code,String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        String name = this.name();
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
